<html>
<head>
<title>Cotizacion</title>
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/tablas.css" rel="stylesheet">
<script src="../js/jquery-1.9.0.min.js"></script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="../bootstrap/css/bootstrap-responsive.css" rel="stylesheet" media="screen">
  <style type="text/css">
<!--

.Estilo1 {font-size: 36px}
.Estilo2 {	color: #000000;font-size: 36px;}
body {
	background-color: #CCFF33;
	background-image: url();
	background-repeat: no-repeat;
}
.Estilo3 {color: #FFFFFF}
.Estilo4 {color: #000000;font-weight: bold;font-style: italic;}
-->

    </style>
<?php

include('configuracion.php');
// maximo por pagina
$limit = 10;

// pagina pedida
$pag = (int) $_GET["pag"];
if ($pag < 1)
{
   $pag = 1;
}
$offset = ($pag-1) * $limit;


$sql = "SELECT SQL_CALC_FOUND_ROWS * FROM clientes LIMIT $offset, $limit";
$sqlTotal = "SELECT FOUND_ROWS() as total";

$rs = mysql_query($sql);
$rsTotal = mysql_query($sqlTotal);

$rowTotal = mysql_fetch_assoc($rsTotal);
// Total de registros sin limit
$total = $rowTotal["total"];

?>
</head>
<body>
<center>
<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
					<span class="icon-bar"></span>
            		<span class="icon-bar"></span>
            		<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</a>
		  </div>
				<b><a class="brand" href="../index.html">ABRASISA</a></b>
          			<div class="nav-collapse collapse">
					
            			
						<ul class="nav">
              				<li class="active"><a href="listaCotizacion.php">Regresar</a></li>
            			</ul>
						
				 </div>
										
   </div>
</div><!--/.nav-collapse --> 
<hr></hr>
<b><h3>Lista de Clientes </h3></b>
<div class='container'>
<table class='table table-striped'>
   <thead>
      <tr>
         <td> <font face=\"verdana\">ID</font></td>
         <td><font face=\"verdana\">Nombre</font></td>
		  <td><font face=\"verdana\">Direccion</font></td>
		  <td> <font face=\"verdana\">Telefono</font></td>
         <td><font face=\"verdana\">R.F.C</font></td>
		  <td><font face=\"verdana\">E-mail</font></td>
      </tr>
   </thead>
   <tbody>
      <?php
         while ($row = mysql_fetch_assoc($rs))
         {
            $id = $row["idCli"];
            $name = htmlentities($row["nombre"]);
			 $direc = htmlentities($row["direccion"]);
			  $tel = htmlentities($row["telefono"]);
			 $rfc = htmlentities($row["rfc"]);
			  $email = htmlentities($row["email"]);
         ?>
         <tr>
            <td><font face=\"verdana\"><?php echo $id; ?></font></td>
            <td><font face=\"verdana\"><?php echo $name; ?></font></td>
			<td><font face=\"verdana\"><?php echo $direc; ?></font></td>
			<td><font face=\"verdana\"><?php echo $tel; ?></font></td>
            <td><font face=\"verdana\"><?php echo $rfc; ?></font></td>
			<td><font face=\"verdana\"><?php echo $email; ?></font></td>
         </tr>
         <?php
         }
      ?>
   </tbody>
   <tfoot>
      <tr>
         <td colspan="6">
      <?php
         $totalPag = ceil($total/$limit);
         $links = array();
         for( $i=1; $i<=$totalPag ; $i++)
         {
            $links[] = "<a href=\"?pag=$i\">$i</a>"; 
         }
         echo implode(" - ", $links);
      ?>
         </td>
      </tr>
   </tfoot>
</table>
</div>



</body>
</html>
